package cn.doitedu.day05

import cn.doitedu.day01.utils.SparkUtil
import org.apache.spark.rdd.RDD

/**
 * @Date 22.4.1
 * @Created by HANGGE
 * @Description
 */
object C13_转换算子_KeyBy {

  def main(args: Array[String]): Unit = {

    val sc = SparkUtil.getSc

    val rdd1: RDD[String] = sc.parallelize(List("a", "c", "d", "f", "b") )
    val res: RDD[(String, String)] = rdd1.keyBy(e => e.toUpperCase)
    res.foreach(println)

  }
}
